package org.testis.webautomationmodule.services;

import org.testis.data.TestStepException;
import org.testis.data.TestStepResultType;


/**
 *A factory class creates WebAutomationModuleProviderService 
 * @author nurhat
 */
public class WebAutomationModuleProviderServiceFactory
{

    /**
     * A factory method creates WebAutomationModuleProviderService
     * according to given type. e.g. if type is "selenium", it will create
     * SeleniumWebAutomationModuleProviderService
     * @param type
     * @return
     */
    public static WebAutomationModuleProviderService getService()
    {
        String type = "selenium";
        if (type.equalsIgnoreCase("selenium")) {
            return new SeleniumWebAutomationModuleProviderService();
        }
        else {
            throw new TestStepException(
                TestStepResultType.MISTAKE,
                "At WebAutomationProviderService no defined web automation provider service with type of" +
                type + "");
        }
    }
}
